package org.lojzesframework.freeMarker.gen;

import java.util.HashMap;
import java.util.Map;

import org.lojzesframework.freeMarker.datamodel.JspData;
import org.lojzesframework.freeMarker.utils.FileUtils;
import org.lojzesframework.freeMarker.utils.FreeMakerUtils;

public class JspGenFile implements GenFile {

	public boolean genFiles() {
		String jspFileName = "index.jsp";
		String jspTplName = "jsp.ftl";
		JspData jspData = new JspData();
		jspData.setName("lojzes");
		jspData.setPic("lojzes.jpg");
		Map map = new HashMap();
		map.put("jspData", jspData);
		String content = FreeMakerUtils.getContent(jspTplName, map);
		return FileUtils.writeFile(GenFile.baseFilePath + jspFileName, content);
	}
}
